#include "irq.h"

#include "stdio.h"
#include "sched.h"
#include "screen.h"
#include "common.h"
#include "lock.h"
#include "smp.h"
#include "test.h"

static void init_pcb_core1()
{
}

void smp_bootstrap(void)
{
    reset_timer();
    set_cp0_status(0x10008001);
    while (1)
        ;
}

void ipi_write64(unsigned long arg1, void *arg2)
{
}

/*
 * Setup the PC, SP, and GP of a secondary processor and start it runing!
 */
void loongson3_boot_secondary()
{
    uint64_t *MailBox0;
    uint64_t *MailBox1;
    uint64_t *MailBox2;
    uint64_t *MailBox3;

    MailBox0 = (uint64_t *)0xffffffffbfe11120;
    MailBox1 = (uint64_t *)0xffffffffbfe11128;
    MailBox2 = (uint64_t *)0xffffffffbfe11130;
    MailBox3 = (uint64_t *)0xffffffffbfe11138;

    *MailBox1 = SECONDARY_SP;
    *MailBox2 = SECONDARY_GP;
    *MailBox3 = 0;
    *MailBox0 = (uint64_t)&smp_bootstrap;
}

void core_lock_aquire(void)
{
}

void core_lock_release(void)
{
}